package com.weiyi.portal.controller;

import com.weiyi.common.common.api.CommonResult;
import com.weiyi.portal.modules.pms.model.PmsComment;
import com.weiyi.portal.modules.pms.model.PmsCommentReplay;
import com.weiyi.portal.modules.pms.service.PmsCommentReplayService;
import com.weiyi.portal.modules.pms.service.PmsCommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("")
public class NewController {

    @Autowired
    PmsCommentService pmsCommentService;
    @Autowired
    PmsCommentReplayService pmsCommentReplayService;

    @RequestMapping
    public CommonResult addComment(@RequestBody PmsComment pmsComment){
        boolean save = pmsCommentService.save(pmsComment);
        if(save)return CommonResult.success(save);
        return CommonResult.failed();
    }

    @RequestMapping
    public CommonResult addCommentReply(@RequestBody PmsCommentReplay pmsCommentReplay){
        boolean save = pmsCommentReplayService.save(pmsCommentReplay);
        if(save)return CommonResult.success(save);
        return CommonResult.failed();
    }
}
